import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
// 第一模块路由
import { routes1 as subProjectRoutes } from '@/modules/moules1/modules1_BigRevelution/router/index'
// 第六模块路由
import { routes6 } from '@/modules/module6/module6-zongshu/router.js'
import Book from '@/modules/module6/module6-zongshu/views/Book/book1.vue'
import Book2 from '@/modules/module6/module6-zongshu/views/Book/book2.vue'
import Book3 from '@/modules/module6/module6-zongshu/views/Book/book3.vue'
import ContactUs from '@/modules/module6/module6-zongshu/views/ContactUs.vue'
import Events from '@/modules/module6/module6-zongshu/views/Events.vue'
import Home from '@/modules/module6/module6-zongshu/views/Home.vue'
import PartyHistory from '@/modules/module6/module6-zongshu/views/PartyHistory.vue'
import Shehui from '@/modules/module6/module6-zongshu/views/Shehui.vue'
// 第二模块路由
import { routes2 } from '@/modules/module2/module2-tudi/router.js'
import Home1 from '@/modules/module2/module2-tudi/views/Home.vue'; // 假设你有一个 Home.vue 作为首页
import RevolutionaryHeroes from '@/modules/module2/module2-tudi/views/RevolutionaryHeroes.vue'; // 革命英雄页面
import LatestDocuments from '@/modules/module2/module2-tudi/views/LatestDocuments.vue'; // 最新文献页面
import VideoMaterials from '@/modules/module2/module2-tudi/views/VideoMaterials.vue'; // 影视资料页面
import AudioMaterials from '@/modules/module2/module2-tudi/views/AudioMaterials.vue'; // 音频资料页面
//第五模块路由
import { routes5 } from '@/modules/module5/module5-xin/router/index.js'
import Home2 from '@/modules/module5/module5-xin/components/Home.vue';
import PreludeView from '@/modules/module5/module5-xin/components/PreludeView.vue';
import FoundingProcessView from '@/modules/module5/module5-xin/components/FoundingProcessView.vue';
import SignificanceView from '@/modules/module5/module5-xin/components/SignificanceView.vue';
import highlight1 from '@/modules/module5/module5-xin/components/highlight1.vue'; // 详情页面组件  
import highlight2 from '@/modules/module5/module5-xin/components/highlight2.vue';
import highlight3 from '@/modules/module5/module5-xin/components/highlight3.vue';
//第三块路由
//第四模块路由
import { routes4 } from '@/modules/module4/modules4-War/router.js'
import Home4 from '@/modules/module4/modules4-War/components/Home.vue'
import Historys from '@/modules/module4/modules4-War/components/Historys.vue'
import Important from '@/modules/module4/modules4-War/components/Important.vue'
import Battle from '@/modules/module4/modules4-War/components/Battle.vue'
import Persons from '@/modules/module4/modules4-War/components/Persons.vue'
import tab1 from '@/modules/module4/modules4-War/components/pages/Tab1.vue'
import tab2 from '@/modules/module4/modules4-War/components/pages/Tab2.vue'
import tab3 from '@/modules/module4/modules4-War/components/pages/tab3.vue'
import tab4 from '@/modules/module4/modules4-War/components/pages/Tab4.vue'
// import { routes3 } from '@/modules/module3/module3-kangri/router/index.js';
const mainProjectRoutes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('@/views/index.vue')
  },
  {
    path: '/modules1-big-revelution',
    component: () => import('@/modules/moules1/modules1_BigRevelution/App.vue')
  },
  {
    path: '/GreatReselution',
    component: () =>
      import('@/modules/moules1/modules1_BigRevelution/views/GreatReselutionView.vue')
  },
  {
    path: '/Time',
    component: () => import('@/modules/moules1/modules1_BigRevelution/views/TimeView.vue')
  },
  {
    path: '/biography',
    component: () => import('@/modules/moules1/modules1_BigRevelution/views/FIgureView.vue')
  },
  // 第六模块路由
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/history',
    name: 'PartyHistory',
    component: PartyHistory
  },
  {
    path: '/events',
    name: 'Events',
    component: Events
  },
  {
    path: '/contact',
    name: 'ContactUs',
    component: ContactUs
  },
  {
    path: '/shehui',
    name: 'Shehui',
    component: Shehui
  },
  {
    path: '/book1',
    name: 'Book',
    component: Book
  },
  {
    path: '/book2',
    name: 'Book2',
    component: Book2
  },
  {
    path: '/book3',
    name: 'Book3',
    component: Book3
  },
  //第二模块路由
  {
    path: '/home1',
    name: 'Home1',
    component: Home1
  },
  {
    path: '/revolutionary-heroes',
    name: 'RevolutionaryHeroes',
    component: RevolutionaryHeroes
  },
  {
    path: '/latest-documents',
    name: 'LatestDocuments',
    component: LatestDocuments
  },
  {
    path: '/video-materials',
    name: 'VideoMaterials',
    component: VideoMaterials
  },
  {
    path: '/audio-materials',
    name: 'AudioMaterials',
    component: AudioMaterials
  },



  //第五块路由
  {
    path: '/home2',
    name: 'Home2',
    component: Home2
  },
  {
    path: '/prelude',
    name: 'Prelude',
    component: PreludeView
  },
  {
    path: '/founding',
    name: 'Found',
    component: FoundingProcessView
  },
  {
    path: '/significance',
    name: 'Significance',
    component: SignificanceView // 添加新路由
  },
  {
    path: '/highlight1',
    name: 'highlight1',
    component: highlight1
  },
  {
    path: '/highlight2',
    name: 'highlight2',
    component: highlight2
  },
  {
    path: '/highlight3',
    name: 'highlight3',
    component: highlight3
  },
  //第四模块路由
  {
    path: "/home4",
    component: Home4,
  },
  {
    path: "/Historys",
    component: Historys,
  },
  {
    path: "/Battle",
    component: Battle,
  },
  {
    path: "/Important",
    component: Important,
  },
  {
    path: "/Persons",
    component: Persons,
    children: [
      {
        path: "tab1",
        component: tab1
      },
      {
        path: "tab2",
        component: tab2
      },
      {
        path: "tab3",
        component: tab3
      },
      {
        path: "tab4",
        component: tab4
      }
    ]
  },
  {
    path: '/modules4',
    component: () => import('@/modules/module4/modules4-War/App.vue')
  }
]

//第三块路由 

export const routes3 = [
  {
    path: '/test',
    name: 'Home7',
    meta: {
      title: '主页',
      icon: 'HomeFilled'
    },
    component: () => import('@/views/index.vue')

  },
  {
    path: '/home3',
    name: 'Home3',
    meta: {
      title: '首页',
      icon: 'HomeFilled'
    },
    component: () => import('@/modules/module3/module3-kangri/views/Home.vue')

  },
  {
    path: '/timeline',
    name: 'Timeline',
    meta: {
      title: '战争时间线',
      icon: 'Timer'
    },
    component: () => import('@/modules/module3/module3-kangri/views/Timeline.vue')
  },
  {
    path: '/heroes',
    name: 'Heroes',
    meta: {
      title: '抗战英雄',
      icon: 'user'
    },
    component: () => import('@/modules/module3/module3-kangri/views/Heroes.vue')
  },
  {
    path: '/battles',
    name: 'Battles',
    meta: {
      title: '重要战役',
      icon: 'flag'
    },
    component: () => import('@/modules/module3/module3-kangri/views/Battles.vue')
  },
  {
    path: '/gallery',
    name: 'Gallery',
    meta: {
      title: '历史图片',
      icon: 'picture'
    },
    component: () => import('@/modules/module3/module3-kangri/views/Gallery.vue')
  },
]
// 合并主项目和子项目的路由
const routes: RouteRecordRaw[] = [...mainProjectRoutes, ...subProjectRoutes, ...routes6, ...routes2, ...routes5, ...routes3, ...routes4]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
